<?php
/* @var $this KelurahanAnggotaController */
/* @var $model KelurahanAnggota */
/* @var $form CActiveForm */
global $penguruskelurahan;
?>
<?php if(Yii::app()->user->hasFlash('penguruskelurahan')): ?>

<div class="flash-success">
<?php echo Yii::app()->user->getFlash('penguruskelurahan'); ?>
</div>
<?php else: ?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'kelurahan-anggota-form',
	'enableAjaxValidation'=>false,
)); ?>



	<?php echo $form->errorSummary($model); ?>
    <table border="0" cellpadding="0" cellspacing="0" id="id-form">
        <tr>
            <th valign="top"><?php  echo $form->labelEx($model,'id_kelurahan'); ?></th>
            <td class="idform">
                <?php  echo u::get_model_by_id('kelurahan',$model->id_kelurahan)->nama_kelurahan ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('id_kelurahan')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'id_kelurahan', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php  echo $form->labelEx($model,'id_laskar'); ?></th>
            <td class="idform">
                <?php echo $form->hiddenField($model, 'id_laskar'); ?>
                <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                'name' => 'id_laskar_auto',
                'source' => url('kelurahananggota/getlistjamaah'),
                'value'=> $model->idLaskar == null ? "" : $model->idLaskar->nama,//$model->ketua0->nama,
                'options' => array(
                    'showAnim' => 'fold',
                    'select' => 'js:function(event, ui){ jQuery("#' . CHtml::activeId($model, 'id_laskar') .
                        '").val(ui.item["id"]); }'),
                'htmlOptions' => array('size' => '60'))); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('id_laskar')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'id_laskar', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $form->labelEx($model, 'jabatan'); ?></th>
            <td class="idform">
                <?php echo $form->dropDownList($model, 'jabatan', $penguruskelurahan, array(
                'empty' => '(Pilih Jabatan)',
                'style' => 'width:200px')); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('jabatan')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'jabatan', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        
        <tr>
            <th>&nbsp;</th>
            <td valign="top">
                <?php echo CHtml::submitButton($model->isNewRecord ? 'Buat' : 'Simpan',array('class'=>'form-submit')); ?>
            </td>
            <td class="idform"></td>
        </tr>
    </table>
<?php $this->endWidget(); ?>

</div><!-- form -->
<?php endif; ?>